'use strict';
// const {
// 	cityDatas
// } = require('data-common')
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)

	const cityDatas = [{
			text: "赣州市",
			value: 1325
		},
		{
			text: "瑞金市",
			value: 1326
		},
		{
			text: "南康区",
			value: 1327
		},
		{
			text: "赣县",
			value: 1328
		},
		{
			text: "信丰县",
			value: 1329
		},
		{
			text: "大余县",
			value: 1330
		},
		{
			text: "上犹县",
			value: 1331
		},
		{
			text: "崇义县",
			value: 1332
		},
		{
			text: "安远县",
			value: 1333
		},
		{
			text: "龙南县",
			value: 1334
		},
		{
			text: "定南县",
			value: 1335
		},
		{
			text: "全南县",
			value: 1336
		},
		{
			text: "宁都县",
			value: 1337
		},
		{
			text: "于都县",
			value: 1338
		},
		{
			text: "兴国县",
			value: 1339
		},
		{
			text: "会昌县",
			value: 1340
		},
		{
			text: "寻乌县",
			value: 1341
		},
		{
			text: "石城县",
			value: 1342
		}
	];
	cityDatas.forEach(async item => {
		console.log("refreshWeather item is: ", item)
		await uniCloud.callFunction({
			name: "getWeatherHistory",
			data: {
				cityId: item.value
			}
		})
	});

	//返回数据给客户端
	// return event
};